<template>
    <div class="maxBox">
        <div>
        <p>{{articalTitle}}</p>
        <input type="text" v-model="articalTitle">
        <input type="text" v-model="articalDescription">
        <!-- <input type="text" v-model="articalContent"> -->
        <textarea class="contentDiv" v-model="articalContent"></textarea>

        <input type="button" @click="update" value="修改">
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return{
            articalTitle:'',
            articalDescription:'',
            articalContent:''
        }
    },
    methods:{
        update(){
            this.$router.push({path:"/myBlog/myArtical",query:{
                _id:this.$route.query.aa,
                title:this.articalTitle,
                description:this.articalDescription,
                articalContent:this.articalContent
            }})
        }
    },
    mounted:function(){
        this.$axios.get('/api/myBlog/edit',{
            params:{
                _id:this.$route.query.aa
            }
        }).then(res=>{
            var ret=res.data[0];
            this.articalTitle=ret.title;
            this.articalDescription=ret.description;
            this.articalContent=ret.articalContent
            //console.log(ret.title)
            //let keyindex=this.$route.query.aa;

        })
    }
}
</script>
<style scoped>
.maxBox{
    display: flex;
    justify-content: center;
    align-items: center;
}
.maxBox p{
    font-size: 30px;
    color:white;
    text-align: center;
}
.maxBox input{
    width: 300px;
    height: 50px;
    border:none;
    display: block;
    background-color: transparent;
    border-bottom: 2px solid aqua;
    margin-top:50px;
    color:white;
}
.maxBox input[type=button]{
    width: 300px;
    height: 50px;
    border:none;
    display: block;
    background-color: aqua;
    margin-top:50px;
    color:white;
}
textarea{
    width: 300px;
    height: 100px;
    border:none;
    display: block;
    background-color: transparent;
    border-bottom: 2px solid aqua;
    margin-top:50px;
    color:white;
    overflow: auto;
    white-space: pre-wrap;
    
}
</style>